package com.clickpaas.governmentcloud.entity.portalentity.rep;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 方延杰
 * @version 1.0
 * @since 2018/3/23 4:20 下午
 */
@Data
@NoArgsConstructor
public class ResponseResult<T> {

    /**
     * 返回是否成功
     */
    boolean success;

    /**
     * 返回代码
     */
    Integer code;

    /**
     * 返回信息
     */
    String msg;

    /**
     * 泛型数据
     */
    T data;

    public ResponseResult(ResultCode resultCode, T data) {
        this.success = resultCode.success();
        this.code = resultCode.code();
        this.msg = resultCode.msg();
        this.data = data;
    }

}